package com.example.audiostreaming.utils;

import android.util.Log;

/**
 * Log日志工具类
 * 1.控制Log日志是否输出
 * 2.并加上包名和修饰文字
 */
public class UtilLog {

    public static String sTAG = "UtilLog";

    //控制是否要输出Log日志
    //true，输出。false，不输出
    public static boolean sOutput = true;

    public static void init(String PackageName, boolean sOutput) {
        sTAG = PackageName;//包名
        UtilLog.sOutput = sOutput;
    }

    public static void d(String TAG, String content) {
        if (sOutput) {
            Log.d(" 包名：" + sTAG + " => " + "类名：" + TAG, "内容：" + content);
        }
    }

    public static void v(String TAG, String content) {
        if (sOutput) {
            Log.v(" 包名：" + sTAG + " => " + "类名：" + TAG, "内容：" + content);
        }
    }

    public static void i(String TAG, String content) {
        if (sOutput) {
            Log.i(" 包名：" + sTAG + " => " + "类名：" + TAG, "内容：" + content);
        }
    }

    public static void w(String TAG, String content) {
        if (sOutput) {
            Log.w(" 包名：" + sTAG + " => " + "类名：" + TAG, "内容：" + content);
        }
    }

    public static void e(String TAG, String content) {
        if (sOutput) {
            Log.e(" 包名：" + sTAG + " => " + "类名：" + TAG, "内容：" + content);
        }
    }
}
